﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace CPUMoniterWPF.Helper
{
    class FormUtil
    {
        public static Color GetColor(float ratef)
        {
            if (ratef >= 0f && (double)ratef <= 50.0)
            {
                return Color.FromArgb(200, Convert.ToByte((double)ratef * 5), 250, 0);
            }
            if ((double)ratef > 50.0 && (double)ratef <= 100.0)
            {
                double d = (100 - (double)ratef) * 5;
                return Color.FromArgb(200, 250, Convert.ToByte(d), 0);
            }
            return Color.FromArgb(200, 150, 150, 255);

        }
    }
}
